const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
    title: 'Hutnis 知识库',
    tagline: '建设中...',
    url: 'http://121.196.175.55',
    baseUrl: '/',
    onBrokenLinks: 'throw',
    onBrokenMarkdownLinks: 'warn',
    favicon: 'img/favicon.ico',
    organizationName: 'hutnis', // Usually your GitHub org/user name.
    projectName: 'hutnis_knowledge_base', // Usually your repo name.
    plugins: [
        [
            require.resolve('@cmfcmf/docusaurus-search-local'), {
                indexDocs: true,
                indexPages: false,
                docsRouteBasePath: '/docs',
                language: 'zh',
            }
        ],
        [
            '@docusaurus/plugin-content-docs',
            { // 规范
                id: 'spec',
                path: 'spec',
                routeBasePath: 'spec',
                editUrl: 'https://gitee.com/Elinpf/hutnis_knowledge_base/edit/master',
                sidebarPath: require.resolve('./sidebarsSpec.js'),
            },
        ],
    ],
    themeConfig: {
        navbar: {
            title: 'Hutnis',
            logo: {
                alt: 'My Site Logo',
                src: 'img/logo.svg',
            },
            items: [{
                type: 'doc',
                docId: 'intro',
                position: 'left',
                label: '知识库',
            },
            {
                to: '/spec/introduction',
                activeBasePath: 'spec',
                label: '编写规范',
                position: 'left'
            },
            {
                href: 'https://gitee.com/Elinpf/hutnis_knowledge_base',
                label: 'Gitee',
                position: 'right',
            },
            ],
        },
        footer: {
            style: 'dark',
            copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
        },
        prism: {
            theme: lightCodeTheme,
            darkTheme: darkCodeTheme,
        },
    },
    presets: [
        [
            '@docusaurus/preset-classic',
            {
                docs: {
                    sidebarPath: require.resolve('./sidebars.js'),
                    // Please change this to your repo.
                    editUrl: 'https://gitee.com/Elinpf/hutnis_knowledge_base/edit/master',
                },
                theme: {
                    customCss: require.resolve('./src/css/custom.css'),
                },
            },
        ],
    ],
};